package com.zhuiyun.project.api.products.productsort.service.impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhuiyun.project.api.products.productsort.entity.ProductSort;
import com.zhuiyun.project.api.products.productsort.mapper.ProductSortMapper;
import com.zhuiyun.project.api.products.productsort.service.ProductSortService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @ClassName ProductServiceImpl
 * @Description TODO 商品分类关联表 接口实现类
 * @Author ypq
 * @Date 2023/10/25 19:12
 **/
@Service
public class ProductSortServiceImpl extends ServiceImpl<ProductSortMapper, ProductSort> implements ProductSortService {

    @Autowired
    private ProductSortMapper productSortMapper;

    /**
     * @Author ypq
     * @Description 根据商品id修改分类id
     * @Date 2023/10/27 15:59
     * @Return int
     * @param productSort
     */
    @Override
    public int editSortIdByProductId(ProductSort productSort) {
        return productSortMapper.editSortIdByProductId(productSort);
    }

    /**
    * @Author ypq
    * @Description 新增商品id与分类id关联表
    * @Date 2023/10/31 16:10
    * @Return boolean
    * @param productSort
    */

    @Override
    public boolean addSortId(ProductSort productSort) {
        return productSortMapper.addSortId(productSort);
    }
}
